import java.io.IOException;
import java.util.ArrayList;

public class main {

	public static void main(String[] args) {
		ReadAddress Input = new ReadAddress();
		ParseAll parser = new ParseAll();
		CalculatePhysicalAddress Addresses = new CalculatePhysicalAddress();
		MemoryManager pageFile1= new MemoryManager();
		
		ArrayList<ArrayList<Integer>> testArray = new ArrayList<ArrayList<Integer>>();
		
		testArray = Input.ReadInput(testArray,"Input.txt"); // read input 
		testArray = parser.ParseInput(testArray); // calculate page number and offset
		testArray = pageFile1.calculateFrameNumber(testArray); //calculate frame number
		testArray = Addresses.calculate(testArray);//work out physical Address 
		testArray = pageFile1.getFromPhysicalMemory(testArray);//retrieve value
		
		
		//print all 
		System.out.println("[Index, Input, PageNumber, Offset, FrameNumber, Physical Address, Value]");
		for(int i = 0;i < testArray.size();i++){
		System.out.println(testArray.get(i)); //index, input, pagenumber, offset, framenumber, physical address, value
		}
		
	}


}
